﻿Public Class About_box

 

    Private Sub tmrappear_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr_appear.Tick
        ' Makes the form appear.
        Dim opacFact As Double = 0.05
        Do While tmr_fade.Enabled = True
            Exit Sub
        Loop
        Me.Opacity = Me.Opacity + opacFact
        If (Me.Opacity = 1) Then
            tmr_appear.Stop()
        End If
    End Sub

    Private Sub About_box_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Opacity = 0
        tmr_appear.Start()
    End Sub

    Private Sub Label1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lbl_close.MouseDown
        ' Turns the X to dark gray once the mouse has been
        ' depressed.
        lbl_close.ForeColor = Color.DarkGray
    End Sub

    Private Sub Label1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lbl_close.MouseUp
        ' Turns the X back to white once the mouse has been clicked
        ' then it closes the form.
        lbl_close.ForeColor = Color.WhiteSmoke
        tmr_fade.Enabled = True
        tmr_fade.Start()

    End Sub


    Private Sub lbl_close_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbl_close.MouseHover
        ' Turns the X to gray once the mouse has entered
        lbl_close.ForeColor = Color.Gainsboro
    End Sub

    Private Sub lbl_close_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbl_close.MouseLeave
        ' Turns the X back to white once the mouse has left.
        lbl_close.ForeColor = Color.WhiteSmoke
    End Sub

    Private Sub About_box_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
         ' Gets the current mouse position.
        a = Control.MousePosition.X - Me.Location.X
        b = Control.MousePosition.Y - Me.Location.Y

    End Sub
    Dim newPoint As New System.Drawing.Point()
    Dim a As Integer
    Dim b As Integer
Private Sub About_box_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
        ' Takes the mouse position away from the login window  
        ' position and moves the login window to where the mouse is.
        If Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None Then

            If e.Button = MouseButtons.Left Then
                newPoint = Control.MousePosition
                newPoint.X = newPoint.X - (a)
                newPoint.Y = newPoint.Y - (b)
                Me.Location = newPoint

            End If

        End If
    End Sub

    Private Sub tmr_fade_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmr_fade.Tick
        ' Makes the form disappear, and the login form appear.
        Dim opacFact As Double = 0.05
        Me.Opacity = Me.Opacity - opacFact

        If (Me.Opacity = 0) Then
            Me.Close()
            tmr_fade.Stop()
        End If
    End Sub
End Class
